package com.antoco.operation.bigscreen.model.dto;

import lombok.Data;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@Data
@ApiModel(value="SensorParamDTO")
public class SensorParamDTO {

    @NotNull(message = "设备大类不能为空")
    @Pattern(regexp = "[1-2]", message = "设备大类必须是1或2")
    @ApiModelProperty(value = "设备大类 1-水质，2-水量", example="2")
    private String devBigType;

    @ApiModelProperty(value = "设备大类名称", example="水量")
    private String devBigTypeName;

    @NotNull(message = "设备类型不能为空")
    @Pattern(regexp = "[1-8]", message = "设备类型必须是1至8")
    @ApiModelProperty(value = "设备类型 1-电子水尺，2-窑井水位仪，3-雨量计，4-智能井盖，5-CH2，6-H2S，7-CO，8-PH", example="1")
    private String devType;

    @ApiModelProperty(value = "设备类型名称", example="电子水尺")
    private String devTypeName;

    @NotNull(message = "设备名称不能为空")
    @ApiModelProperty(value = "设备名称", example="0001")
    private String name;

    @NotNull(message = "地理位置名称不能为空")
    @ApiModelProperty(value = "地理位置名称", example="南京某区某街道")
    private String gisName;

    @NotNull(message = "地理位置经度不能为空")
    @Digits(integer = 10, fraction = 6, message = "地理位置经度必须是数字")
    @ApiModelProperty(value = "地理位置经度", example="118.22")
    private String gisJindu;

    @NotNull(message = "地理位置纬度不能为空")
    @Digits(integer = 10, fraction = 6, message = "地理位置纬度必须是数字")
    @ApiModelProperty(value = "地理位置纬度", example="33.14")
    private String gisWeidu;

    @ApiModelProperty(value = "设备状态 warn-告警，空-正常", example="warn")
    private String state;

    @ApiModelProperty(value = "设备状态名称", example="告警")
    private String stateName;

    @NotNull(message = "信号情况不能为空")
    @Pattern(regexp = "[1-2]", message = "信号情况必须是1或2")
    @ApiModelProperty(value = "信号情况 1-正常，2-差", example="1")
    private String xinhao;

    @ApiModelProperty(value = "信号情况名称", example="正常")
    private String xinhaoName;

    @NotNull(message = "调试状态不能为空")
    @Pattern(regexp = "[1-2]", message = "调试状态必须是1或2")
    @ApiModelProperty(value = "调试状态 1-是 ，2-否", example="1")
    private String tiaosi;

    @ApiModelProperty(value = "调试状态名称 1-是 ，2-否", example="是")
    private String tiaosiName;

    @NotNull(message = "安装时间不能为空")
    @ApiModelProperty(value = "安装时间", example="2020-11-15 22:57:13")
    private String buildTime;

    @NotNull(message = "超声波水位不能为空")
    @Min(value = 0, message = "超声波水位必须是正数")
    @ApiModelProperty(value = "超声波水位", example="20")
    private String caosenboSuiwei;

    @NotNull(message = "压力水位不能为空")
    @Min(value = 0, message = "压力水位必须是正数")
    @ApiModelProperty(value = "压力水位", example="20")
    private String yaliSuiwei;

    @NotNull(message = "离水底高度不能为空")
    @Min(value = 0, message = "离水底高度必须是正数")
    @ApiModelProperty(value = "离水底高度", example="20")
    private String hightForBottom;

    @NotNull(message = "剩余电量不能为空")
    @Min(value = 0, message = "剩余电量必须是正整数")
    @Max(value = 1, message = "剩余电量必须小于1")
    @ApiModelProperty(value = "剩余电量", example="0.1")
    private String senyuDianlian;

    @ApiModelProperty(value = "值类型名称", example="")
    private String valType;

    @ApiModelProperty(value = "值单位名称", example="")
    private String valTypeName;

    @NotNull(message = "预警阀值不能为空")
    @Min(value = 0, message = "预警阀值必须是正数")
    @ApiModelProperty(value = "预警阀值", example="300")
    private String alarmLimitVal;

    @NotNull(message = "告警阀值不能为空")
    @Min(value = 0, message = "告警阀值必须是正数")
    @ApiModelProperty(value = "告警阀值", example="400")
    private String warnLimitVal;
}